package com.terabits.smartriver.service.impl;

import com.terabits.smartriver.mapper.AlarmMapper;
import com.terabits.smartriver.mapper.DeviceMapper;
import com.terabits.smartriver.mapper.OverhaulMapper;
import com.terabits.smartriver.meta.po.Device;
import com.terabits.smartriver.service.AlarmService;
import com.terabits.smartriver.util.PageData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Yin on 2019/3/15
 */
@Service
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class AlarmServiceImpl implements AlarmService {
    @Autowired
    private AlarmMapper alarmMapper;
    @Autowired
    private DeviceMapper deviceMapper;
    @Autowired
    private OverhaulMapper overhaulMapper;

    @Override
    public List<PageData> getAlarm(PageData pageData) {
        List<PageData> res = alarmMapper.selectAlarm(pageData);
        return res;
    }

    @Override
    public List<PageData> getMaintain(PageData pageData) {
        List<PageData> overhaul = overhaulMapper.getOverhaul(pageData);
        return overhaul;
    }
}
